<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:include="ui/common/taglibs::head">
</head>
<link rel="stylesheet" type="text/css" th:href="@{/jadeEasyUi/defaultControls/css/datagrid/datagrid-rtl/datagrid-rtl.css}">
<body>
<div class="easyui-layout" data-options="fit:true">
		<div class="floating_layer">
	        <b class='fold_button fold_button_right' onclick='exPand(this)'>展开搜索</b>
	    </div>
		<div data-options="region:'north'" class="ycSearch searchArea">
			<!-- 查询条件表单 -->
			<form id="search_form" >
				<div class="searchP searchPad">
					<em>登录名称：</em>
					<input type="text" name="loginName" class="easyui-textbox" data-options=""/>
				</div>
				<div class="searchP searchPad">
					<em>登录名称：</em>
					<input type="text" name="loginName" class="easyui-textbox" data-options=""/>
				</div>
				<div class="searchP searchPad">
					<em>登录名称：</em>
					<input type="text" name="loginName" class="easyui-textbox" data-options=""/>
				</div>
				<div class="searchP searchPad">
					<em>登录名称：</em>
					<input type="text" name="loginName" class="easyui-textbox" data-options=""/>
				</div>
				<div class="searchP spButton">
					<p><a href="javascript:void(0)" class="sQuery" onclick=""></a></p>	
			 	</div>
			</form>
		</div>
		
		<div data-options="region:'center'" >
			<div class="easyui-layout ycBottom" data-options="fit:true">
				<!-- 页面操作按钮 -->
				<div id="gridview-toolbar" class="tableTopButton clearfix">
		            <p><a href="javascript:void(0)" id="tips" onclick="javascript:ConfigSp.tips()" >tips框</a></p>
		            <p><a href="javascript:void(0)" onclick="javascript:ConfigSp.pageDealing()" >页面框</a></p>
		            <p><a href="javascript:void(0)" onclick="javascript:ConfigSp.layerInput()" >弹窗表单</a></p>
		            <p><a href="javascript:void(0)" onclick="javascript:ConfigSp.dbyqDealing()" >iframe框</a></p>
		            <p><a href="javascript:void(0)" onclick="javascript:ConfigSp.publishWorkInfo()" >确认框</a></p>
		            <p><a href="javascript:void(0)" onclick="javascript:ConfigSp.logind()" >加载层</a></p>
		            <p><a href="javascript:void(0)" onclick="javascript:ConfigSp.pudfalse()" >提示框</a></p>
		        </div>
				
				<div data-options="region:'center'" class="yTable autoWidth">
					<table id="list"></table>
				</div>
			</div>
		</div>
</div>		

<script type="text/javascript">


$(function(){
	$('#list').datagrid({
		fit: true,
		idField:'id',
		//rownumbers:true,
		striped: true,
		autoRowHeight:false,
		url:'[[${ctx}]]/getJson?json=datagridJson',
		frozenColumns:[ [{field:'option',title:'操作', align:'center',width:110, formatter:function (value, rec, index){
        	var a = "<a href=\"#\" class=\"ytFont\" onclick=\"javascript:edit('"+rec.memberId+"')\">"+"编辑"+"</a>";
        	var b = "<a href=\"#\" class=\"ytFont\" onclick=\"javascript:addMemberFee('"+rec.memberId+"')\">"+"缴费录入"+"</a>";
        	return b+' '+'&nbsp;'+a;
        }} 
        ]],
		columns:[ [ 
		    {field:'id',title:'主键',hidden:true},
		    {field:'ck',checkbox:true},
		    {field:'index',title:'序号',width:50, align: 'center',formatter:function(val,row,index){
			     var options = $("#list").datagrid('getPager').data("pagination").options; 
			     var currentPage = options.pageNumber;
			     var pageSize = options.pageSize;
			     if(currentPage==0){
                     currentPage=1;
                     return (pageSize * (currentPage-1))+(index+1);
                 }
			     return (pageSize * (currentPage -1))+(index+1);
			}},
			
		    {field:'productid',title:'登录名称', align:'center',width:150,formatter:function(value, rec, index){
	           	  return "<a href='javascript:void()' onclick='' class='tabsTit' title='"+ value +"'>"+value+"</a>";
        	}},
            {field:'unitcost',title:'用户姓名', align:'left',width:100,formatter:function(value, rec, index){
           	  return "<span title='"+ value +"'>"+value+"</span>";
        	}},
            {field:'status',title:'状态', align:'center',width:100,formatter:function(value, rec, index){
        		if (value == '0') {
               		return "<span class='tabsMail'></span>";
               	} else {
               		return "<span class='tabsMailOpen'></span>";
               	}
          	}},
            {field:'listprice',title:'附件', align:'center',width:100,formatter:function(value, rec, index){
          		if (value == '0') {
               		return "<span class='tabsAttachment'></span>";
               	} else {
               		return " ";
               	}
          	}},
            {field:'attr1',title:'33333', align:'left',width:100,formatter:function(value, rec, index){
             	  return "<span title='"+ value +"'>"+value+"</span>";
          	}},
            {field:'itemid',title:'666', align:'left',width:100,formatter:function(value, rec, index){
             	  return "<span title='"+ value +"'>"+value+"</span>";
          	}}
		]],
		toolbar:'#gridview-toolbar', 
		pagination:true,
		pageSize: 10,//每页显示的记录条数，默认为
		pageList: [10,20,30,40,50],//可以设置每页记录条数的列表   pageList: [10,20,30,40,50]
	    queryParams:{},
		onLoadSuccess:function(data){
		    $('#list').datagrid('clearSelections');	//清除掉列表选中记录
		     //debugger;
			$('.datagrid-row div').each(function(){
				var aa = $(this).css('text-align');
				if(aa == 'left'){
					$(this).css('margin-left',0);
				}
				if(aa == 'right'){
					$(this).css('margin-right',0);
				}
			})
			if(data.total==0){					
				$('.datagrid-body-inner').eq(0).addClass("l_elist");					
				$('.datagrid-body').eq(1).append('<div class="r_elist">暂无数据显示</div>');					
			}else{
			    $('.datagrid-body-inner').eq(0).removeClass("l_elist");
			}
		}

	});
	
//  确认框
	ConfigSp.publishWorkInfo=function(){
        top.layer.confirm('确定要发布信息吗?', {
            icon: 1,
            title:'发布信息',
            btn: ['确定', '取消'],
            yes:function(){
                
            },
            btn2:function(index){
                layer.close(index);
            },
            cancel: function(){

            }
        });
    };
//  提示框
	ConfigSp.pudfalse=function(){
        top.layer.msg('玩命提示中',{
        		icon: 3,
        		skin:'informational',
        	}
        );
    };
  
//  tips框
    ConfigSp.tips = function(){
    	layer.tips('上', '#tips', {//class或ID为点击的按钮的class或ID
    		  tips: [1, '#0FA6D8'] //还可配置颜色，1 2 3 4代表上右下左四个位置
    	});
    }
//  加载层  
    ConfigSp.logind = function(){
    	top.layer.load(2,{
    		time: 10*1000,//最长等待时间
    		icon: 1
    	});//ajax回调体中关闭它
    }
//  弹窗表单
    var api = frameElement.api;
    if(api != undefined){
        var W = api.opener;
    }else{
        W=self;
    }
    ConfigSp.layerInput = function(){
        top.layer.open({
            type: 2,//iframe层
            title: 'iframe框',
            maxmin: true,
            skin:'aaaaaaaaaa',
            shadeClose: false, //点击遮罩关闭层
            area : ['800px' , '620px'],
            success: function(layero){
                top.layer.setTop(layero); //重点2
                acontraction();
            },
            content:"[[${ctx}]]/toPage?page=ui/layoutLeftRight/layerInput",
            btn: ['确定','上一步','下一步','取消'],
            yes: function(index, layero){
	            //按钮【按钮一】的回调
	            var iframe = this.iframe.contentWindow;
	            iframe.ConfigSp.dealYqsq(self);
	            parent.location.reload();//刷新父页面
	        },
	        btn1: function(index, layero){
                //按钮【按钮二】的回调
                layer.close(index);
                //return false 开启该代码可禁止点击该按钮关闭
            },
            btn2: function(index, layero){
                //按钮【按钮三】的回调
                layer.close(index);
            },
            btn3: function(index, layero){
                //按钮【按钮四】的回调
                layer.close(index);
            },
            cancel: function(){
                //右上角关闭回调
                //return false 开启该代码可禁止点击该按钮关闭
            }
        });
    };
//  iframe框 
    var api = frameElement.api;
    if(api != undefined){
        var W = api.opener;
    }else{
        W=self;
    }
    ConfigSp.dbyqDealing = function(){
        top.layer.open({
            type: 2,//iframe层
            title: 'iframe框',
            maxmin: true,
            skin:'aaaaaaaaaa',
            shadeClose: false, //点击遮罩关闭层
            area : ['800px' , '620px'],
            success: function(layero){
                top.layer.setTop(layero); //重点2
                acontraction();
            },
            content:"[[${ctx}]]/toPage?page=ui/layoutLeftRight/page2",
            btn: ['确定','上一步','下一步','取消'],
            yes: function(index, layero){
	            //按钮【按钮一】的回调
	            var iframe = this.iframe.contentWindow;
	            iframe.ConfigSp.dealYqsq(self);
	            parent.location.reload();//刷新父页面
	        },
	        btn1: function(index, layero){
                //按钮【按钮二】的回调
                layer.close(index);
                //return false 开启该代码可禁止点击该按钮关闭
            },
            btn2: function(index, layero){
                //按钮【按钮三】的回调
                layer.close(index);
            },
            btn3: function(index, layero){
                //按钮【按钮四】的回调
                layer.close(index);
            },
            cancel: function(){
                //右上角关闭回调
                //return false 开启该代码可禁止点击该按钮关闭
            }
        });
    };
//  页面框
	ConfigSp.pageDealing = function(yqId,module){
        top.layer.open({
            type: 1,//iframe层
            title: '页面框',
            maxmin: true,
            //closeBtn: 0,
            shadeClose: false, //点击遮罩关闭层
            area : ['800px' , '620px'],
            content:"",
            btn: ['确定','取消']
            ,yes: function(index, layero){
                //按钮【按钮一】的回调
                var iframe = this.iframe.contentWindow;
                iframe.ConfigSp.dealYqsq(self);
                parent.location.reload();//刷新父页面
            }
            ,btn2: function(index, layero){
                //按钮【按钮二】的回调
                layer.close(index);
                //return false 开启该代码可禁止点击该按钮关闭
            }
            ,cancel: function(){
                //右上角关闭回调
                //return false 开启该代码可禁止点击该按钮关闭
            }
        });
    };
    ConfigSp.opener=function(message){
        if(message){
            if(message.flag == "true"){
                W.$.dialog.tips(message.content,3);
                dg.close();
                //刷新页面
                ConfigSp.dbYqclSearch();
            } else{
                W.$.dialog.alert(message.content,"error");
                return false;
            }
        }
        // 操作失败
        else{
            return false;
        }
    }
    
    
	acontraction();
})  
	

</script>
</body>
</html>
